package com.lottery.obtainData;

import com.lottery.dao.pc28.robotDao.RobotBetamountDao;
import com.lottery.dao.pc28.robotDao.RobotInfoDao;
import com.lottery.dao.qiuqiu.robotDao.RobotBettypeDao;
import com.lottery.service.qiuqiu.JedisClient;
import com.lottery.utils.CheckOnlieUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class ThreadRedisRead implements Runnable {
	private static final Logger logger = LoggerFactory.getLogger(CheckOnlieUser.class);

	@Autowired
	private JedisClient jedisClient;

//	@Autowired
//	private RobotBetamountDao robotBetamountDao;
//
//	@Autowired
//	private RobotBettypeDao robotBettypeDao;
//
//	@Autowired
//	private RobotInfoDao robotInfoDao;

	@Override
	public void run() {
//		logger.info("*****************************ThreadRedisRead start *********************");
//		// TODO Auto-generated method stub
//		RobotParams.robotinfo = robotInfoDao.selectAll();
//		RobotParams.robotBet = robotBettypeDao.selectAll();
//		ArrayList<String> mo = robotBetamountDao.selectAll();
//		if (mo != null && mo.size() == 2) {
//			int min = Integer.parseInt(mo.get(0));
//			int max = Integer.parseInt(mo.get(1));
//			if (min > max) {
//				RobotParams.robotBetMin = max;
//				RobotParams.robotBetMax = min;
//			} else {
//				RobotParams.robotBetMin = min;
//				RobotParams.robotBetMax = max;
//			}
//		}
//		for (RobotInfo one : RobotParams.robotinfo) {
//			RobotParams.robotinfoMap.put(one.getRobotId(), one);
//		}
//		logger.info("***data:robotinfo,robotBet,robotBetAmount::***" + RobotParams.robotinfo.size() + ","
//				+ RobotParams.robotBet.size() + ",");
//		logger.debug("***************************RedisMsgPubSubListener**************************");
//		//RedisMsgPubSub jedisPubSub = new RedisMsgPubSub();
		jedisClient.subscribe("robotparams");

	}

}
